package com.yikome.shop.utils;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

public class RequestUtils {

	public static Map<String , Object> converToMapFirst(HttpServletRequest request){
		Map<String , Object> params = new HashMap<>();
		
		Map<String, String[]> parameterMap = request.getParameterMap();
		for(Map.Entry<String, String[]> map : parameterMap.entrySet()) {
			String[] values = map.getValue();
			if(values != null && values.length > 0) {
				params.put(map.getKey(), values[0]);
			}
		}
		return params;
	}
}